home *** CD-ROM | disk | FTP | other *** search
- /*
- strsave: save a string in a malloc'd area. Return a pointer to the
- string.
-
- Kenneth Ingham
-
- Copyright (C) the University of New Mexico
- */
-
- #include "defs.h"
-
- char *
- strsave(s)
- char *s;
- {
- return strcpy(xmalloc((unsigned)strlen(s)+1), s);
- }
-
- /*
- note that in strnsave we allocate enough space to put a null at the
- end.
- */
- char *
- strnsave(s,n)
- char *s;
- unsigned int n;
- {
- return strncpy(xmalloc(n+1), s, (int)n);
- }
-